<template>
	<view style="width: 100vw;height: 100vh; background-color: #efefef;overflow: auto;">
		<view  v-for="item in data_list"
			style="background-color: #fff;width: 90vw;margin: 10rpx auto;padding: 10rpx 10rpx;">
			<view  @click="toMap(item)" style="display: flex;justify-content:space-between;align-items: center;">
				
				<view  style="font-size: 30rpx;font-weight: 700;">{{item.cusCompanySimpleName}}</view>
				<view style="font-size: 20rpx;font-weight: 700;color: #d87272;">{{item.addTime}}</view>
			</view>
			<view  @click="toMap(item)" style=" margin-top: 20rpx;">
				{{item.note?item.note:''}}
			</view>
			<view @click="phone_btn(item)" style="color: red; margin-top: 20rpx;">{{item.cusRealName}}-{{item.cusPhone}}
			</view>
		</view>

	</view>
</template>

<script>
	export default {

		data() {
			return {
				data_list: [],
			}
		},

		onLoad(e) {

		},
		// 在 App.vue 中设置页面切换监听
		onShow() {

		},
		mounted() {
			let that = this
			that.$u.api.findCompanyCusList({
				page: {
					pageNum: 1,
					pageSize: 999,
				},
				cusTypeId: '8',
			}).then(res => {

				that.data_list = res.data.list

			});


		},
		methods: {
			phone_btn(e) {
				uni.makePhoneCall({
					phoneNumber: e.cusPhone,
					success: () => {
						console.log("成功拨打电话")


					}
				});
			},
			
			// 调起第三方地图导航
			toMap(e) {
				const that = this
				const U = that.U
				let lat = null
				let lng = null
				lat = e.addressLonlat.split(',')[1]
				lng = e.addressLonlat.split(',')[0]
				console.log(lat,lng,'lng')
				U.toMapMp(lat, lng, e.cusCompanyName, e.cusCompanyName);
			
			
			},

		},



	}
</script>

<style lang="less">

</style>